﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _03Test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            int a = Convert.ToInt32(TextBox1.Text);
            int b = int.Parse(TextBox2.Text.ToString());
            int d = a * b;
            for (int c = 0; ;)
            {//存放余数
                if (a > b)
                {
                    if (a % b == 0)
                    {
                        Label3.Text = ("a，b的最小公倍数为：" + d / b);
                        break;
                    }
                    c = a % b;
                    a = c;

                }
                else if (a < b)
                {
                    if (b % a == 0)
                    {
                        Label3.Text = ("a，b的最小公倍数为：" + d / b);
                        break;
                    }
                    c = b % a;
                    b = c;

                }

            }
        }
        catch (Exception ec)
        {
            Response.Write(ec.StackTrace);
        }

    }
}